package org.rcy.framework.rpc.config;

import org.rcy.framework.rpc.loadbalance.LoadBalanceType;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author 吴康桥
 * @Description
 * @date 2024/6/13 10:53
 */

@ConfigurationProperties(prefix = RpcProperties.PREFIX)
public class RpcProperties {
	public static final String PREFIX = "rpc";

	private ServerProperties server = new ServerProperties();
	private ClientProperties client = new ClientProperties();

	public ClientProperties getClient() {
		return client;
	}

	public void setClient(ClientProperties client) {
		this.client = client;
	}

	public ServerProperties getServer() {
		return server;
	}

	public void setServer(ServerProperties server) {
		this.server = server;
	}

	public static class ServerProperties extends ThriftServerConfig{
		private static final long serialVersionUID = 1L;
	}

	public static class ClientProperties {
		private LoadBalanceType loadBalanceType;

		public LoadBalanceType getLoadBalanceType() {
			return loadBalanceType;
		}

		public void setLoadBalanceType(LoadBalanceType loadBalanceType) {
			this.loadBalanceType = loadBalanceType;
		}

	}
}
